////////////////////////////////////////////////////////////////////////////////
// Copyright 2005 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   SYS_LANG
// AUTHOR           :   Victor Zheng 
// DATE CREATE      :   2005/12/21
// DESCRIPTION      :   a PK file for the function, SYS_LANG
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2005/12/21   Victor Zheng    1.0                 source is generated.
//
//
//
////////////////////////////////////////////////////////////////////////////////

package com.erp.app.admin.sysLang.pk;

import com.erp.framework.model.pk.SimplePageEditStylePk;

/**
* <p>A <strong>PK</strong>(Primay Key) stores the primary key which
* uniquely identifies each bean that is derived from database tables.
* A primary key can be a simple key, made up of a single attribute, or
* it can be a composite key, made up of a group of attributes from the bean.
* <br>
* As a suggested best practice, the PK class must implements the optional
* <code>java.lang.Object</code> methods, such as <code>equals</code> and
* <code>hashCode</code>
*
* @author          Victor Zheng 
* @version 1.0     2005/12/21
* @since           FrameWork 1.0
*
*/
public class SysLangPk extends SimplePageEditStylePk {

	//PK Attributes
	public String langCode;
	
	/**
	* Allocates and creates a new <code>Pk</code> that contains data from
	* the incoming parameters.
	*
	* @param      langCode       the incoming lang code
	* @author     Victor Zheng 
	* @since      FrameWork 1.0
	*/
	public SysLangPk(String langCode) {
		this.langCode = langCode;
	}

	/**
	* Return a unique number representing the hash code for the
	* primary key instance.  Ensure that the hash code is indeed
	* unique when it is computed from the primary key attributes.
	* @return     the computed integer representing the primary key
	*
	* @author     Victor Zheng 
	* @since      FrameWork 1.0
	*/
	public int hashCode() {
		return (this.langCode).hashCode();
	}

	/**
	* Properly evaluate the equality of two primary keys
	* by comparing values for each part of the composite key.
	* @param      obj     the primary key to compare this <code>String</code>
	*                     against.
	* @return     <code>true</code>     if the <code>primary keys</code> are equal;
	*             <code>false</code>    otherwise.
	*
	* @author     Victor Zheng 
	* @since      FrameWork 1.0
	*/
	public boolean equals(Object obj) {
		if (obj instanceof SysLangPk) {
			SysLangPk pk2 = (SysLangPk) obj;
			return (this.langCode != null && this.langCode.equals(pk2.langCode));			
		}
		return false;
	}

	/**
	* Converts to a string representing the data in this object.
	* A new <code>String</code> object is allocated and initialized to 
	* contain the character sequence currently represented by this 
	* object. This <code>String</code> is then returned. Subsequent 
	* changes to this object do not affect the contents of the 
	* <code>String</code>. 
	*
	* @return     a string representation of the object.
	* @see        java.lang.Object#toString()
	* @author     Victor Zheng 
	* @since      FrameWork 1.0
	*/
	public String toString() {
		return "{langCode = " + this.langCode + "}";		
	}

	//Getters only
	public String getLangCode() {
		return langCode;
	}

}
